extends layout

block content
  include includes/navbar.pug
  h1 图片分享
  .row
    .col-12.col-md-8
      .card.m-1
        h3.card-title 图片上传
        .card-body
          form(action="/images/", method="post", enctype="multipart/form-data")
            .form-group.row
              label.col-sm-2 浏览
              input.col-sm-10.form-control-file(type='file',name='imgfile')
            .form-group.row
              label.col-sm-2 标题
              input.col-sm-8.form-control(type='text', name='title')
            .form-group.row
              label.col-sm-2 描述
              input.col-sm-8.form-control(type='text', name='description')
            .form-group.row
              .offset-md-8.col-sm-2
                button.btn.btn-primary.btn-block(type='submit') 提交
      .row
        .col-12.col-md-8
          .row
            each image in images
              a.col-6.col-md-4(href=`/images/show/${image._id}`)
                .card
                  img.card-img-top(src=`/uploads/${image.diskfilename}`, alt=image.description)
                  .card-body
                    p.card-text= image.title
    .col-12.col-md-4
      include includes/stats.pug
      include includes/comment.pug
  block footer
    .mx-auto(style='text-align:center') Design By Soft163--林王未